package io.kiki.stack.netty.command;

import io.kiki.stack.netty.invoker.RpcCommandType;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Setter
@Getter
public abstract class RequestCommand extends AbstractCommand {
    private static final long serialVersionUID = 1L;
    /**
     * timeout, -1 stands for no timeout
     */
    private int timeout = -1;

    public RequestCommand() {
        super(RpcCommandType.REQUEST);
    }

    public RequestCommand(CommandCode code) {
        super(RpcCommandType.REQUEST, code);
    }

    public RequestCommand(byte type, CommandCode code) {
        super(type, code);
    }

    public RequestCommand(byte version, byte type, CommandCode code) {
        super(type, code);
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }
}
